$OpenBSD: patch-src_spy_libpcscspy_c,v 1.3 2013/10/28 15:10:25 dcoppa Exp $
--- src/spy/libpcscspy.c.orig	Mon Oct 28 15:54:51 2013
+++ src/spy/libpcscspy.c	Mon Oct 28 15:56:33 2013
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <sys/time.h>
 #include <pthread.h>
+#include <inttypes.h>
 
 #include "misc.h"
 #include <winscard.h>
@@ -169,7 +170,7 @@ static void spy_line_direct(char *line)
 	if (Log_fd < 0)
 		return;
 
-	snprintf(threadid, sizeof threadid, "%lX@", pthread_self());
+	snprintf(threadid, sizeof threadid, "%" PRIXPTR "@", (uintptr_t)pthread_self());
 	pthread_mutex_lock(&Log_fd_mutex);
 	r = write(Log_fd, threadid, strlen(threadid));
 	r = write(Log_fd, line, strlen(line));
@@ -198,7 +199,7 @@ static void spy_line(const char *fmt, ...)
 		printf("libpcsc-spy: Buffer is too small!\n");
 		return;
 	}
-	snprintf(threadid, sizeof threadid, "%lX@", pthread_self());
+	snprintf(threadid, sizeof threadid, "%" PRIXPTR "@", (uintptr_t)pthread_self());
 	pthread_mutex_lock(&Log_fd_mutex);
 	r = write(Log_fd, threadid, strlen(threadid));
 	r = write(Log_fd, line, size);
